import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Login from '../views/Login.vue'
import Teacher from '../views/Teacher.vue'
import Student from '../views/Student.vue'


Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    name: 'Home',
    component: Home,
    redirect:'/home/student',
    children:[
      {
        path: 'teacher',
        name: 'Teacher',
        component: Teacher,
      },
      {
        path: 'student',
        name: 'Student',
        component: Student,
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component:Login
  },
  { path: '/', redirect: '/login' }
]

const router = new VueRouter({
  routes
})

export default router
